package com.itheima.mapper;

import com.github.pagehelper.Page;
import com.itheima.common.entity.QueryPageBean;
import com.itheima.pojo.CheckGroup;
import com.itheima.pojo.CheckItem;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CheckGroupDao {
    /*新增检查组*/
    @Insert("insert into t_checkgroup(code,name,helpCode,sex,remark,attention)" +
            "values"+
            " (#{code}, #{name}, #{helpCode}, #{sex}, #{remark}, #{attention}")
    void add(CheckGroup checkGroup);
    /*删除检查组*/
    @Delete("delete from t_checkgroup where id=#{id}")
    void deleteById(Long id);
    /*根据套餐id查询检查组id*/
    List<String> findCheckGroupIdsBySetmealId(Long setmealId);
    /*分页查询*/
    Page<CheckGroup> pageQuery(QueryPageBean queryPageBean);
    /*编辑检查组*/
    void edit(CheckGroup checkGroup);
    /*查询所有检查组*/
    @Select("select * from t_checkgroup")
    List<CheckGroup> findAll();
    /*根据id查询检查组*/
    @Select("select * from t_checkgroup where id=#{id}")
    CheckGroup findById(Long id);
    /*删除检查组套餐关系*/
    @Delete("delete from t_setmeal_checkgroup where id=#{checkGroupId}")
    void deleteties(Integer checkGroupId);
    /*新增检查组套餐关系*/
    void addties(Integer checkGroupId, List<Long> ids);
}
